package com.aaa.ssm.service.impl;

import com.aaa.ssm.dao.SchedulingDao;
import com.aaa.ssm.entity.Patient;
import com.aaa.ssm.entity.Scheduling;
import com.aaa.ssm.service.SchedulingService;
import com.aaa.ssm.util.Page;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
@Service
public class SchedulingServiceImpl implements SchedulingService {
    @Resource
    private SchedulingDao schedulingDao;
    @Override
    public List<Scheduling> queryByParam(Scheduling scheduling) {
        return schedulingDao.queryByParam(scheduling);
    }

    @Override
    public Scheduling queryById(Integer gtid) {
        return schedulingDao.queryById(gtid);
    }

    @Override
    public int add(Scheduling scheduling) {
        return schedulingDao.add(scheduling);
    }

    @Override
    public int update(Scheduling scheduling) {
        return schedulingDao.update(scheduling);
    }

    @Override
    public int delete(Integer gtid) {
        return schedulingDao.delete(gtid);
    }



    @Override
    public PageInfo queryByPage(Page<Scheduling> page){
        //设值分页参数   startPage(int pageNum, int pageSize)  pageNum 第几页  pageSize 页面
        PageHelper.startPage(page.getPageNo(), page.getPageSize());
        return new PageInfo(schedulingDao.queryByParam(page.getData()));
    }
}
